.class public Les/wj;
.super Ljava/lang/Object;
.source "NativeGifDecoder.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Les/wj$a;
    }
.end annotation


# instance fields
.field private a:Landroid/net/LocalSocket;

.field public b:Ljava/lang/String;

.field public c:I

.field public d:I

.field private e:[B


# direct methods
.method public constructor <init>(Landroid/net/LocalSocket;II)V
    .locals 2

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-object v0, p0, Les/wj;->a:Landroid/net/LocalSocket;

    const/4 v1, 0x0

    .line 3
    iput v1, p0, Les/wj;->c:I

    .line 4
    iput v1, p0, Les/wj;->d:I

    .line 5
    iput-object v0, p0, Les/wj;->e:[B

    .line 6
    iput-object p1, p0, Les/wj;->a:Landroid/net/LocalSocket;

    .line 7
    iput p2, p0, Les/wj;->c:I

    .line 8
    iput p3, p0, Les/wj;->d:I

    mul-int p2, p2, p3

    mul-int/lit8 p2, p2, 0x4

    .line 9
    new-array p1, p2, [B

    iput-object p1, p0, Les/wj;->e:[B

    return-void
.end method


# virtual methods
.method public a(Landroid/graphics/Bitmap;)Les/wj$a;
    .locals 8
    .annotation build Landroidx/annotation/Nullable;
    .end annotation

    const/4 v0, 0x0

    .line 1
    :try_start_0
    iget-object v1, p0, Les/wj;->a:Landroid/net/LocalSocket;

    invoke-virtual {v1}, Landroid/net/LocalSocket;->getInputStream()Ljava/io/InputStream;

    move-result-object v1
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_5
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    .line 2
    :try_start_1
    iget-object v2, p0, Les/wj;->a:Landroid/net/LocalSocket;

    invoke-virtual {v2}, Landroid/net/LocalSocket;->getOutputStream()Ljava/io/OutputStream;

    move-result-object v2
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_4
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    const/16 v3, 0xff

    .line 3
    :try_start_2
    invoke-static {v2, v3}, Lcom/estrongs/fs/impl/local/j;->a(Ljava/io/OutputStream;I)V

    .line 4
    invoke-static {v1}, Lcom/estrongs/fs/impl/local/j;->b(Ljava/io/InputStream;)I

    move-result v3
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_3
    .catchall {:try_start_2 .. :try_end_2} :catchall_2

    const-string v4, "EEE"

    if-eqz v3, :cond_2

    .line 5
    :try_start_3
    new-instance p1, Ljava/lang/StringBuilder;

    invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "get response failed:"

    invoke-virtual {p1, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-static {v4, p1}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_2

    if-eqz v1, :cond_0

    .line 6
    :try_start_4
    invoke-virtual {v1}, Ljava/io/InputStream;->close()V

    goto :goto_0

    :catch_0
    move-exception p1

    goto :goto_1

    :cond_0
    :goto_0
    if-eqz v2, :cond_1

    .line 7
    invoke-virtual {v2}, Ljava/io/OutputStream;->close()V

    .line 8
    :cond_1
    iget-object p1, p0, Les/wj;->a:Landroid/net/LocalSocket;

    invoke-virtual {p1}, Landroid/net/LocalSocket;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_0

    return-object v0

    .line 9
    :goto_1
    invoke-virtual {p1}, Ljava/io/IOException;->printStackTrace()V

    return-object v0

    .line 10
    :cond_2
    :try_start_5
    new-instance v3, Les/wj$a;

    invoke-direct {v3}, Les/wj$a;-><init>()V

    .line 11
    invoke-static {v1}, Lcom/estrongs/fs/impl/local/j;->b(Ljava/io/InputStream;)I

    move-result v5

    mul-int/lit8 v5, v5, 0xa

    iput v5, v3, Les/wj$a;->b:I

    if-nez v5, :cond_3

    const/16 v5, 0x64

    .line 12
    iput v5, v3, Les/wj$a;->b:I

    .line 13
    :cond_3
    iput-object v0, v3, Les/wj$a;->a:Landroid/graphics/Bitmap;

    const/4 v5, 0x0

    .line 14
    :goto_2
    iget-object v6, p0, Les/wj;->e:[B

    array-length v6, v6

    if-ge v5, v6, :cond_7

    .line 15
    iget-object v6, p0, Les/wj;->e:[B

    iget-object v7, p0, Les/wj;->e:[B

    array-length v7, v7

    sub-int/2addr v7, v5

    invoke-virtual {v1, v6, v5, v7}, Ljava/io/InputStream;->read([BII)I

    move-result v6

    const/4 v7, -0x1

    if-ne v6, v7, :cond_6

    const-string p1, "read error"

    .line 16
    invoke-static {v4, p1}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_5
    .catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_3
    .catchall {:try_start_5 .. :try_end_5} :catchall_2

    if-eqz v1, :cond_4

    .line 17
    :try_start_6
    invoke-virtual {v1}, Ljava/io/InputStream;->close()V

    goto :goto_3

    :catch_1
    move-exception p1

    goto :goto_4

    :cond_4
    :goto_3
    if-eqz v2, :cond_5

    .line 18
    invoke-virtual {v2}, Ljava/io/OutputStream;->close()V

    .line 19
    :cond_5
    iget-object p1, p0, Les/wj;->a:Landroid/net/LocalSocket;

    invoke-virtual {p1}, Landroid/net/LocalSocket;->close()V
    :try_end_6
    .catch Ljava/io/IOException; {:try_start_6 .. :try_end_6} :catch_1

    return-object v0

    .line 20
    :goto_4
    invoke-virtual {p1}, Ljava/io/IOException;->printStackTrace()V

    return-object v0

    :cond_6
    add-int/2addr v5, v6

    goto :goto_2

    .line 21
    :cond_7
    :try_start_7
    iget-object v4, p0, Les/wj;->e:[B

    invoke-static {v4}, Ljava/nio/ByteBuffer;->wrap([B)Ljava/nio/ByteBuffer;

    move-result-object v4
    :try_end_7
    .catch Ljava/io/IOException; {:try_start_7 .. :try_end_7} :catch_3
    .catchall {:try_start_7 .. :try_end_7} :catchall_2

    if-eqz p1, :cond_8

    .line 22
    :try_start_8
    invoke-virtual {p1, v4}, Landroid/graphics/Bitmap;->copyPixelsFromBuffer(Ljava/nio/Buffer;)V

    .line 23
    iput-object p1, v3, Les/wj$a;->a:Landroid/graphics/Bitmap;

    goto :goto_5

    .line 24
    :cond_8
    iget p1, p0, Les/wj;->c:I

    iget v5, p0, Les/wj;->d:I

    sget-object v6, Landroid/graphics/Bitmap$Config;->ARGB_8888:Landroid/graphics/Bitmap$Config;

    invoke-static {p1, v5, v6}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object p1

    iput-object p1, v3, Les/wj$a;->a:Landroid/graphics/Bitmap;

    .line 25
    invoke-virtual {p1, v4}, Landroid/graphics/Bitmap;->copyPixelsFromBuffer(Ljava/nio/Buffer;)V
    :try_end_8
    .catch Ljava/lang/Exception; {:try_start_8 .. :try_end_8} :catch_2
    .catchall {:try_start_8 .. :try_end_8} :catchall_2

    goto :goto_5

    :catch_2
    move-exception p1

    .line 26
    :try_start_9
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_9
    .catch Ljava/io/IOException; {:try_start_9 .. :try_end_9} :catch_3
    .catchall {:try_start_9 .. :try_end_9} :catchall_2

    :goto_5
    return-object v3

    :catch_3
    move-exception p1

    goto :goto_6

    :catchall_0
    move-exception p1

    move-object v2, v0

    goto :goto_9

    :catch_4
    move-exception p1

    move-object v2, v0

    goto :goto_6

    :catchall_1
    move-exception p1

    move-object v1, v0

    move-object v2, v1

    goto :goto_9

    :catch_5
    move-exception p1

    move-object v1, v0

    move-object v2, v1

    .line 27
    :goto_6
    :try_start_a
    invoke-virtual {p1}, Ljava/io/IOException;->printStackTrace()V
    :try_end_a
    .catchall {:try_start_a .. :try_end_a} :catchall_2

    if-eqz v1, :cond_9

    .line 28
    :try_start_b
    invoke-virtual {v1}, Ljava/io/InputStream;->close()V

    goto :goto_7

    :catch_6
    move-exception p1

    goto :goto_8

    :cond_9
    :goto_7
    if-eqz v2, :cond_a

    .line 29
    invoke-virtual {v2}, Ljava/io/OutputStream;->close()V

    .line 30
    :cond_a
    iget-object p1, p0, Les/wj;->a:Landroid/net/LocalSocket;

    invoke-virtual {p1}, Landroid/net/LocalSocket;->close()V
    :try_end_b
    .catch Ljava/io/IOException; {:try_start_b .. :try_end_b} :catch_6

    return-object v0

    .line 31
    :goto_8
    invoke-virtual {p1}, Ljava/io/IOException;->printStackTrace()V

    return-object v0

    :catchall_2
    move-exception p1

    :goto_9
    if-eqz v1, :cond_b

    .line 32
    :try_start_c
    invoke-virtual {v1}, Ljava/io/InputStream;->close()V

    goto :goto_a

    :catch_7
    move-exception p1

    goto :goto_b

    :cond_b
    :goto_a
    if-eqz v2, :cond_c

    .line 33
    invoke-virtual {v2}, Ljava/io/OutputStream;->close()V

    .line 34
    :cond_c
    iget-object v1, p0, Les/wj;->a:Landroid/net/LocalSocket;

    invoke-virtual {v1}, Landroid/net/LocalSocket;->close()V
    :try_end_c
    .catch Ljava/io/IOException; {:try_start_c .. :try_end_c} :catch_7

    .line 35
    throw p1

    .line 36
    :goto_b
    invoke-virtual {p1}, Ljava/io/IOException;->printStackTrace()V

    return-object v0
.end method

.method public a()V
    .locals 1

    .line 37
    :try_start_0
    iget-object v0, p0, Les/wj;->a:Landroid/net/LocalSocket;

    invoke-virtual {v0}, Landroid/net/LocalSocket;->close()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    const/4 v0, 0x0

    .line 38
    iput-object v0, p0, Les/wj;->e:[B

    return-void
.end method
